home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 64 / Mac Magazin CD 64.iso / Updates / FileMaker Pro Server / Web Companion / Web Companion.rsrc / HDAT_23220_FMP-IWPTxt.js < prev    next >
Encoding:
JavaScript  |  1999-09-08  |  1.5 KB  |  82 lines

  1. /*
  2.     FMP-IWPTxt.js
  3.     
  4.     (c) Copyright 1999 FileMaker, Inc. All rights reserved.
  5.     
  6.     Modification History:
  7.     2/4/99 KJJ    Created.
  8. */
  9.  
  10. /* IWPData object definition */
  11.  
  12. function get_lang()
  13. {
  14.     if ( this.lang == null )
  15.         this.lang = this.vformat.substring(0,1);
  16.     return this.lang;
  17. }
  18.  
  19. function set_location(obj)
  20. {
  21.     if ( obj != null )
  22.     {
  23.         var result = "";
  24.         var str = obj.href;
  25.         if ( obj.href.indexOf(this.delim) > -1 )
  26.         {
  27.             segments = obj.href.split(this.delim);
  28.             obj.href = "";
  29.             if ( segments[0] != "" )
  30.                 obj.href = segments[0];
  31.             for( i = 1; i < segments.length; ++i )
  32.                 obj.href += this.getlang() + segments[i];
  33.         }
  34.         if ( obj.href.indexOf(this.help) > -1 )
  35.         {
  36.             var win = window.open("","","top=20,left=20,height=460,width=620,fullscreen=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,");
  37.             win.location = obj.href;
  38.         }
  39.         else
  40.             window.location = obj.href;
  41.     }
  42.     return false;
  43. }
  44.  
  45. function submit_form(form)
  46. {
  47.     this.parse(form.elements[this.eFormat]);
  48.     this.parse(form.elements[this.eErr]);
  49.     form.submit();
  50.     return false;
  51. }
  52.  
  53. function parse_elem(obj)
  54. {    
  55.     if ( obj != null )
  56.     {
  57.         if ( obj.value.indexOf(this.delim) > -1 )
  58.         {
  59.             segments = obj.value.split(this.delim)
  60.             obj.value = this.getlang() + segments[1];
  61.         }
  62.     }
  63. }
  64.  
  65. function IWPData()
  66. {
  67.     this.getlang    =    get_lang;
  68.     this.submit        =    submit_form;
  69.     this.parse        =    parse_elem;
  70.     this.go            =    set_location;
  71.     this.delim        =    "~";
  72.     this.english    =    "Z";
  73.     this.eFormat    =    "-format";
  74.     this.eErr        =    "-error";
  75.     this.equ        =    "=";
  76.     this.help        =    "#";
  77. }
  78.  
  79. /* Create Objects */
  80.  
  81. iwp = new IWPData();
  82.